package com.test;


import com.alibaba.excel.EasyExcel;
import com.hospital.entity.Medicine;
import com.hospital.util.PassUtils;
import org.junit.Test;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.List;


public class AddAdmin {

    @Test
    public void addAdmin(){
        //1.生成密钥
//        String key= PassUtils.createAESKey();
//        System.err.println(key);
        String str="147";
        //2.加密
        String p=PassUtils.aesenc("Je8vAxhw/f/CJDu05shjBw==",str);
        System.err.println("密文："+p);
        //3.解密
        System.err.println("解密："+PassUtils.aesdec("Je8vAxhw/f/CJDu05shjBw==",p));
    }

    @Test
    public void t3() throws FileNotFoundException {
        //1.准备数据
        List<Medicine> list=new ArrayList<>();

        //2.调用方法 写出数据  生成Excel文件
        EasyExcel.write(new FileOutputStream("t3.xlsx"),Medicine.class).sheet("自动生成").doWrite(list);
    }
}
